#pragma once
#include "DAEFloat3.h"

/**
* This class servers as a base class to implement rotation controllers.
* This base class can also serve as a constant rotation controller.
* @author Koen Samyn
*/
class RotationController
{
public:
	enum RotationSpace{WORLD,RELATIVETOPARENT};
	/**
	* Creates a new rotation controller.
	*/
	RotationController(void);
	/**
	* Create a new RotationController object with a defined rotation space.
	* @param space the space this rotation controller will operate in.
	*/
	RotationController(RotationSpace space);
	/**
	* Deletes the rotation controller.
	*/
	virtual ~RotationController(void);
	/**
	* Returns the rotation at the given time.
	* @param time the time to evaluate the rotation.
	*/
	virtual DAEFloat3& GetRotation(float time){
		return m_Rotation;
	}

	/**
	* Returns the rotation space. Possible values are : WORLD, RELATIVETOPARENT
	* @return the rotation space.
	*/
	RotationSpace GetRotationSpace(){
		return m_RotationSpace;
	}

	/**
	* Sets the constant rotation for this Rotation Controller.
	* 
	*/
	void SetConstantRotation(DAEFloat3 rotation){
		m_Rotation.SetValues(rotation.x,rotation.y,rotation.z);
	}
private: 
	/**
	* The rotation in euler angles.
	*/ 
	DAEFloat3 m_Rotation;
	/**
	* Indicates that no extra rotation is defined.
	*/
	bool m_IsZeroRotation;
	/**
	* The rotation space for this rotation controller.
	*/ 
	RotationSpace m_RotationSpace;
};

